package de.fuberlin.inf.utils;

import java.util.List;

public class JSON {

	public static String safe(List<? extends JSONable> list) {
		StringBuffer sb = new StringBuffer();
		sb.append("[");
		for (JSONable object : list) {
			sb.append(object.toJSON());
			sb.append(",");
		}
		sb.deleteCharAt(sb.length() - 1);
		sb.append("]");
		return sb.toString();
	}
	public static String unsafe(List<?> list) {
		StringBuffer sb = new StringBuffer();
		sb.append("[");
		for (Object object : list) {
			sb.append("'");
			sb.append(object.toString());
			sb.append("',");
		}
		sb.deleteCharAt(sb.length() - 1);
		sb.append("]");
		return sb.toString();
	}
}
